package com.aps.demo.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;

/**
 * 工艺步骤数据模型
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "工艺步骤数据模型")
public class ProcessStep {
    
    @NotBlank(message = "工序ID不能为空")
    @JsonProperty("operationId")
    @Schema(description = "工序ID", example = "OP001")
    private String operationId;
    
    @NotBlank(message = "工序名称不能为空")
    @JsonProperty("operationName")
    @Schema(description = "工序名称", example = "车削")
    private String operationName;
    
    @Positive(message = "工序序号必须为正数")
    @JsonProperty("sequence")
    @Schema(description = "工序序号", example = "1")
    private Integer sequence;
    
    @NotBlank(message = "设备类型不能为空")
    @JsonProperty("equipmentType")
    @Schema(description = "设备类型", example = "车床")
    private String equipmentType;
    
    @NotNull(message = "标准工时不能为空")
    @JsonProperty("standardTime")
    @Schema(description = "标准工时")
    private TimeValue standardTime;
    
    @NotNull(message = "换型时间不能为空")
    @JsonProperty("setupTime")
    @Schema(description = "换型时间")
    private TimeValue setupTime;
    
    @NotBlank(message = "人员要求不能为空")
    @JsonProperty("personnelRequirement")
    @Schema(description = "人员要求", example = "中级车工")
    private String personnelRequirement;
    
    @NotBlank(message = "质量要求不能为空")
    @JsonProperty("qualityRequirement")
    @Schema(description = "质量要求", example = "表面粗糙度Ra1.6")
    private String qualityRequirement;
    
    /**
     * 时间值模型
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "时间值模型")
    public static class TimeValue {
        @Positive(message = "时间值必须为正数")
        @JsonProperty("value")
        @Schema(description = "时间值", example = "30.0")
        private Double value;
        
        @NotBlank(message = "时间单位不能为空")
        @JsonProperty("unit")
        @Schema(description = "时间单位", example = "分钟")
        private String unit;
    }
} 